home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funprint.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  861 b   |  44 lines

  1. /*
  2. \funcref{fun\_print}{void fun\_print ()}
  3.     {}
  4.     {}
  5.     {print(), xrealloc()}
  6.     {fun\_exec()}
  7.     {funprint.c}
  8.     {
  9.  
  10.         This function prints the arguments to a {\em printf()} statement,
  11.         pushed onto the stack previously. The number of arguments to printf is
  12.         the last pushed value.
  13.  
  14.     }
  15.  
  16. */
  17.  
  18. #include "icm-exec.h"
  19.  
  20. void fun_printf ()
  21. {
  22.     register int
  23.         i,
  24.         nargs;
  25.     int
  26.         newelement;
  27.     register char
  28.         *space,
  29.         *string;
  30.  
  31.     nargs = stack [sp].vu.intval;
  32.  
  33.     for (i = 1; i <= nargs; i += newelement)
  34.     {
  35.         string = getarg (i, &newelement);
  36.         if (stack [sp - i].type & e_list && *string)
  37.             space = " ";
  38.         else
  39.             space = nullstring;
  40.         printf ("%s%s", string, space);
  41.         xrealloc (string, 0);
  42.     }
  43. }
  44.